﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master"
    Inherits="System.Web.Mvc.ViewPage<Entity.PagedList<Entity.Car_Rental.News>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    新闻中心
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="block">
        <div class="Title">
            <span class="BlueTitle">新闻列表</span>
        </div>
        <table class="tableList">
            <tr>
                <th>主题
                </th>
                <th>发布日期
                </th>
            </tr>
            <% 
                if (Model != null && Model.Any())
                {
                    foreach (var item in Model)
                    { %>
            <tr>
                <td><%=Html.ActionLink(item.Title, "Details", "News", new { id = item.NewsID }, new { target = "_blank" })%></td>
                <td><%: String.Format("{0:g}", item.DisplayDate)%></td>
            </tr>

            <% }
                }
                else
                { %>
            <tr>
                <td colspan="2">
                    <%=Html.Pager(Model) %>

                </td>
            </tr>
            <%} %>
        </table>
    </div>
</asp:Content>
